package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.SelfBillingProjectRemoteQuery;
import com.mk.admin.model.vo.SelfBillingBatchVo;
import com.mk.admin.model.vo.SelfBillingCancelVo;
import com.mk.admin.model.vo.SelfBillingVo;
import com.mk.admin.service.SelfBillingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/selfBilling")
@Api(tags = "自助开单", value = "数据和医技预约一样，只是先开单，才能预约，有些开单后不需要预约")
public class SelfBillingController extends BaseController<SelfBillingVo> {

    @Autowired
    private SelfBillingService selfBillingService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody SelfBillingVo vo) {
        return selfBillingService.select(vo);
    }


    @PostMapping("/add")
    @Override
    public ResultDto add(@RequestBody SelfBillingVo vo) {
        return selfBillingService.add(vo);
    }

    @PostMapping("/addBatch")
    @ApiOperation("自助开单开方")
    public ResultDto addBatch(@RequestBody SelfBillingBatchVo vo) {
        return selfBillingService.addBatch(vo);
    }

    @PostMapping("/cancel")
    @ApiOperation("自助开单取消处方")
    public ResultDto cancel(@RequestBody SelfBillingVo vo) {
        return selfBillingService.cancel(vo);
    }

    @PostMapping("/refund")
    @ApiOperation("自助开单退费")
    public ResultDto refund(@RequestBody SelfBillingVo vo) {
        return selfBillingService.refund(vo);
    }

    @PostMapping("/update")
    @Override
    public ResultDto update(@RequestBody SelfBillingVo vo) {
        return selfBillingService.update(vo);
    }

    @PostMapping("/delete")
    @Override
    public ResultDto delete(@RequestBody SelfBillingVo vo) {
        return selfBillingService.delete(vo.getId());
    }

    @PostMapping("/status")
    @Override
    public ResultDto status(@RequestBody SelfBillingVo vo) {
        return selfBillingService.status(vo.getId());
    }
}
